import { Entity, PrimaryGeneratedColumn, Column, Unique } from 'typeorm';

@Entity('admin_user')
export class User {
  // 主键，自增
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  //唯一键，唯一字段为username
  @Unique(['username'])
  username: string;

  @Column()
  password: string;

  @Column()
  avatar: string;

  @Column()
  role: string;
  @Column()
  name: string;
  @Column()
  active: number;
}
